<?php
require("../config.php");
require_once($CONF['root.dir']."database.php");
	
$USERNAME   = $_POST["username"];
$PASSWORD   = $_POST["password"];
$conn->connect();
$SQL = "SELECT 	USERID,USERLOGIN,PASSWORD,STATUS,LASTLOGIN,FROMIP,LASTUPDATE,PRIVILEDGE,NAME,ID_PELAMAR FROM tbluser
		WHERE USERLOGIN = '".$USERNAME."' AND PASSWORD='".md5($PASSWORD)."'";
$exec=$conn->query($SQL);		
$exec->next();
if($exec->size()>0){
	session_start();			
	$_SESSION['AR_userLogin'] = $exec->get(1);
	$_SESSION['AR_userid'] = $exec->get(0);
	$_SESSION['AR_nama'] = $exec->get(8);
	$_SESSION['AR_ID_PELAMAR'] = $exec->get(9);
	$_SESSION['AR_login'] = "Y";
	$_SESSION['AR_Priv'] = $exec->get(7);
	echo "1|Login Success, Please Wait...";
}else{
	echo "0|Username atau Password salah!";
}
$conn->disconnect();
?>